package com.skzh.equipment.service.impl;

import java.util.List;
import com.skzh.common.utils.DateUtils;
import com.skzh.equipment.domain.HailerAnnouncement;
import com.skzh.equipment.mapper.HailerModelInfoMapper;
import com.skzh.equipment.mapper.LightControlMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.skzh.equipment.mapper.HailerInfoMapper;
import com.skzh.equipment.domain.HailerInfo;
import com.skzh.equipment.service.IHailerInfoService;

/**
 * 喊话器设备信息Service业务层处理
 *
 * @author skzh
 * @date 2025-03-21
 */
@Service
public class HailerInfoServiceImpl implements IHailerInfoService {
    @Autowired
    private HailerInfoMapper hailerInfoMapper;
    @Autowired
    private LightControlMapper lightControlMapper;
    @Autowired
    private HailerModelInfoMapper hailerModelInfoMapper;

    /**
     * 查询喊话器设备信息
     *
     * @param id 喊话器设备信息主键
     * @return 喊话器设备信息
     */
    @Override
    public HailerInfo selectHailerInfoById(Long id) {
        return hailerInfoMapper.selectHailerInfoById(id);
    }

    /**
     * 查询喊话器设备信息列表
     *
     * @param hailerInfo 喊话器设备信息
     * @return 喊话器设备信息
     */
    @Override
    public List<HailerInfo> selectHailerInfoList(HailerInfo hailerInfo) {
        return hailerInfoMapper.selectHailerInfoList(hailerInfo);
    }

    /**
     * 新增喊话器设备信息
     *
     * @param hailerInfo 喊话器设备信息
     * @return 结果
     */
    @Override
    public int insertHailerInfo(HailerInfo hailerInfo) {
                hailerInfo.setCreateTime(DateUtils.getNowDate());
            return hailerInfoMapper.insertHailerInfo(hailerInfo);
    }

    /**
     * 修改喊话器设备信息
     *
     * @param hailerInfo 喊话器设备信息
     * @return 结果
     */
    @Override
    public int updateHailerInfo(HailerInfo hailerInfo) {
                hailerInfo.setUpdateTime(DateUtils.getNowDate());
        return hailerInfoMapper.updateHailerInfo(hailerInfo);
    }

    /**
     * 批量删除喊话器设备信息
     *
     * @param ids 需要删除的喊话器设备信息主键
     * @return 结果
     */
    @Override
    public int deleteHailerInfoByIds(Long[] ids) {
        return hailerInfoMapper.deleteHailerInfoByIds(ids);
    }

    /**
     * 删除喊话器设备信息信息
     *
     * @param id 喊话器设备信息主键
     * @return 结果
     */
    @Override
    public int deleteHailerInfoById(Long id) {
        return hailerInfoMapper.deleteHailerInfoById(id);
    }

    @Override
    public List<HailerAnnouncement> selectHailerAnnouncementList() {
        return hailerInfoMapper.selectHailerAnnouncementList();
    }
}
